function DrawImage(ImgD,wvar,hvar)
{
  var flag=false;
  var image=new Image();
  var iwidth = wvar; 
  var iheight = hvar;
  image.src=ImgD.src;
  if(image.width>0 && image.height>0)
  {
    flag=true;
    if(image.width/image.height>= iwidth/iheight)
    {
      
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
     
     
      ImgD.alt=image.width+"x"+image.height;
    }
    else
    {
      
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height; 
     
      ImgD.alt=image.width+"x"+image.Height;      
    }
  }
}
